import { InjectField } from "./InjectDecortator";
import { InjectContructor } from "./InjectContructorDecorator";
import { UserService } from "./UserService";
import { get } from "./MethodDecorator";
import Controller from "./ControllerDecorator";
import CollectionInstance from "./Collection";

@Controller("/")
class UserController {
  @InjectField("userService")
  private userService!: UserService;

  constructor(
    @InjectContructor("userService2") private userService2?: UserService,
    private count?: string
  ) {}

  @get("/login")
  public login(): number {
    let pInstance = CollectionInstance.get("userService2");
    pInstance.login();
    return 2;
  }
}

const cont = new UserController();
cont.login();
